package com.zjmzxfzhl.modules.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.common.base.BaseService;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseIndent;

import java.util.List;

/**
 * Service
 *
 * @author 庄金明
 */
public interface PurchaseIndentService extends BaseService<PurchaseIndent> {
    /**
     * 分页查询
     *
     * @param page
     * @param purchaseIndent
     * @return
     */
    IPage<PurchaseIndent> list(IPage<PurchaseIndent> page, PurchaseIndent purchaseIndent);

    /**
     * 获取数据库中采购订单（不存在则新增）
     * @param indent
     * @return
     */
    PurchaseIndent validPurchaseIndent(PurchaseIndent indent);

    /**
     * 查询未关联合同的采购订单
     * @return
     */
    List<PurchaseIndent> listValidIndentWithoutContract();

    /**
     * 清除采购订单与合同的关联
     * @param contractId
     */
    void emptyContractId(Long contractId);
}
